package com.example.springdemo.service;

import com.example.springdemo.entity.User;
import org.springframework.data.repository.PagingAndSortingRepository;

import java.util.List;

/**
 * @author Wenyi Luo
 * @ClassName UserRepository
 * @Description TODO
 * @date 22/3/6 16:25
 * @version: 1.0
 */
public interface UserRepository extends PagingAndSortingRepository<User,Integer> {
     List<User> findByName(String name);


    /**
     * 返回指定条件给用户
     * @param name
     * @param age
     * @return
     */
     User findDistinctByNameAndAgeGreaterThan(String name,int age);
}
